
<div id="button-wrapper">
<div id="add-team-button"> <a class="push-button" href="<?php echo url('team_management/add'); ?>">Add Team</a></div>
</div>

<div class="contactsList">
    <?php if ($data != NULL): ?>
        <table id="team-management-table" >
        <thead>
            <tr><th>Team Title</th><th>Campaign</th><th>Team Goal</th><th>Operation</th></tr>
        </thead>
        <tbody>
            <?php
            global $user;
            $campaign_list =  get_on_going_compaign_nid_by_seller($user->uid);
            ?>
            <?php foreach ($data as $value): ?>
            <?php //if(in_array($value['campaignid'], $campaign_list)){ ?>
                <tr class="teamFirstRow">
                    <td><a href="javascript:void(0);" id="<?php echo str_replace(' ', '', $value['name'] . $value['nid']); ?>"><?php echo $value['name']; ?></a></td>
                    <td><?php echo $value['campaign']; ?></td>
                    <td><?php echo $value['goal']; ?></td>
                    <td>
                        <a href="<?php echo url('campaign_notification/' . $value['nid']) ?>">Email</a> |
                        <a href="<?php echo url('team_management/edit/' . $value['nid']) ?>">Edit</a> |
                        <a href="<?php echo url('team_management/duplicate/' . $value['nid']) ?>">Duplicate</a> |
                        <a href="<?php echo url('team_management/delete/' . $value['nid']) ?>">Delete</a>
                    </td>
                </tr>
                <tr class="expand-child teamSecondRow <?php echo str_replace(' ', '', $value['name'] . $value['nid']); ?>">
                    <td></td>
                    <td class="teamLabel">Team Member</td>
                    <td>
                        <?php $members = _get_all_team_members($value['nid']); ?>
                        <ul>
                            <?php
                            foreach ($members as $val) {
                                print '<li>' . $val->field_lastname_value . ',' . $val->field_firstname_value . '(' . $val->name . ')' . '</li>';
                            }
                            ?>
                        </ul>
                    </td>
                    <td></td>
                </tr>
            <?php //} ?>
            <?php endforeach; ?>
        </tbody>
        <tfoot></tfoot>
        </table>
    </div>
<?php endif; ?>